package org.jetnuke.common;

import net.jforum.dao.DataAccessDriver;
import net.jforum.entities.User;

;

public class UserInfo implements IUserInfo {
	User user;

	public UserInfo(User user) {
		this.user = user;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IUserInfo#getID()
	 */
	public int getID() {
		return user.getId();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IUserInfo#getName()
	 */
	public String getName() {

		return user.getUsername();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IUserInfo#getUname()
	 */
	public String getUname() {
		return user.getUsername();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IUserInfo#getTheme()
	 */
	
	//TODO
	public String getTheme() {
		try {
			String theme=DataAccessDriver.getInstance().newThemeDAO().selectByID(user.getThemeId()).getStyleName();
			return theme;
		} catch (Exception e) {
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see org.jetnuke.common.IUserInfo#getThemeID()
	 */
	public int getThemeID() {
		
		return user.getThemeId();
	}

	/* (non-Javadoc)
	 * @see org.jetnuke.common.IUserInfo#getPrivateMessagesCount()
	 */
	public int getPrivateMessagesCount() {
		return user.getPrivateMessagesCount();
	}

	/* (non-Javadoc)
	 * @see org.jetnuke.common.IUserInfo#getEMAil()
	 */
	public String getEMAil() {
		
		return user.getEmail();
	}

	/* (non-Javadoc)
	 * @see org.jetnuke.common.IUserInfo#getThemeId()
	 */
	public int getThemeId() {
		
		return user.getThemeId();
	}

}
